package dao;

import java.io.Serializable;
import java.util.List;

import modelo.Caracteristica;

import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.SessionFactory;

import util.HibernateUtil;

public class CaracteristicaDao implements Serializable {

	private static final long serialVersionUID = 474435564039706581L;

	private Session session;
	SessionFactory sessionFactory = HibernateUtil.getSessionFactory();
	
	public CaracteristicaDao() {
		super();
	}
	
	public List<Caracteristica> obtenerCaracteristicas() {
		session=sessionFactory.openSession();
		
		Query query = session.createQuery("SELECT c FROM Caracteristica c");
		List<Caracteristica> c = query.list();
		
		session.close();
		
		return c;
	}
	
}
